package com.lyn.solitude_plugin;

import android.os.Bundle;
import android.widget.Toast;
import androidx.annotation.Nullable;

import com.lyn.xplugin.R;
import com.lyn.xplugin.databinding.ActivityMainBinding;

/**
 * @author longyn 2024/4/14
 * @version 1.0.0
 */
public class MainActivity extends BaseActivity<ActivityMainBinding> {

    private final String TAG = getClass().getSimpleName();

    @Override
    public ActivityMainBinding getViewBinding() {
        return ActivityMainBinding.inflate(getLayoutInflater());
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    private long backPressedTime;

    @Override
    public void onBackPressed() {
        if (System.currentTimeMillis() - backPressedTime >= 1000) {
            Toast.makeText(this, getString(R.string.perform_the_exit_again)
                    , Toast.LENGTH_SHORT).show();
            backPressedTime = System.currentTimeMillis();
            return;
        }
        super.onBackPressed();
    }
}
